<?php
namespace app\common\validate;

use think\Validate;

class Coupon extends Validate
{
    protected $rule = [
        'i_num' => 'require|number',
        'z_num' => 'require|number',
        'start_use' => 'require|dateFormat:Y-m-d',
        'end_use' => 'require|dateFormat:Y-m-d',
        'issue_time' => 'require|dateFormat:Y-m-d H:i',
        'use_validate' => 'require',
        'jump' => 'require|in:1,2,3',
        'sex' => 'in:0,1,2',
        'type' => 'require|in:1,2,3'
    ];
    protected $message = [
        'i_num.require' => '请输入发布数量',
        'i_num.number' => '发布数量格式错误',
        'z_num.require' => '请输入折扣额度',
        'z_num.number' => '折扣额度错误',
        'start_use.require' => '请选择开始时间',
        'start_use.dateFormat' => '开始时间格式错误',
        'end_use.require' => '请选择截止时间',
        'end_use.dateFormat' => '截止时间格式错误',
        'issue_time.require' => '请选择发布时间',
        'issue_time.dateFormat' => '发布时间格式错误',
        'use_validate.require' => '请输入使用限制',
        'jump.require' => '请选择跳转分类',
        'jump.in' => '跳转分类有误',
        'sex.in' => '性别有误',
        'type.require' => '参数type丢失',
        'type.in' => '参数type错误'
    ];
    protected $scene = [
       
    ];
}
